import config from "@/config"
import http from "@/utils/request"

export default {
	list: {
		url: `${config.API_URL2}/api/floor/list`,
		name: "楼层列表",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	delete: {
		url: `${config.API_URL2}/api/floor/del`,
		name: "删除楼层信息",
		delete: async function(ids){
			let deleteUrl = `${this.url}/${ids}`;
			return await http.delete(deleteUrl);
		}
	},
	add: {
		url: `${config.API_URL2}/api/floor/add`,
		name: "增加楼层",
		post: async function(data){
			return await http.post(this.url, data);
		}
	},
	addroom: {
		url: `${config.API_URL2}/api/room/add`,
		name: "增加房间",
		post: async function(data){
			return await http.post(this.url, data);
		}
	},
	roomList: {
		url: `${config.API_URL2}/api/room/list`,
		name: "楼层列表",
		get: async function(params){
			return await http.get(this.url, params);
		}
	},
	roomDel: {
		url: `${config.API_URL2}/api/room/del`,
		name: "删除房间信息",
		delete: async function(ids){
			let deleteUrl = `${this.url}/${ids}`;
			return await http.delete(deleteUrl);
		}
	},
	upload: {
		url: `${config.API_URL2}/api/floor/addImage`,
		name: "文件上传",
		post: async function(data, config={}){
			return await http.post(this.url, data, config);
		}
	},
}
